package com.edu.demo;

import cn.hutool.json.JSONUtil;
import com.edu.demo.mapper.RoleMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: EduApplication
 * @Description:
 * @Author: jixuewei
 * @Date: 2023-01-12
 */
@SpringBootApplication
@MapperScan(basePackages = {"com.edu.demo.mapper"})
@EnableTransactionManagement //开启事务
public class EduApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(EduApplication.class, args);


         BCryptPasswordEncoder b = new BCryptPasswordEncoder();
       String admin123 = b.encode("123"); //加密
        System.out.println("密码："+admin123);

        boolean matches = b.matches("123", admin123); //匹配

        RoleMapper roleMapper = run.getBean("roleMapper", RoleMapper.class);

//        for (int i = 1; i <4 ; i++) {
//            for (int j = 44; j < 60; j++) {
//                roleMapper.insertRoleMenu(3,j);
//            }

//        }
    }

}
